package com.example.tbplus14.Test;

import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class CusTest {

    public static void main(String[] args) {
        // 5. 归档完成后，记录今天已经归档的数据
        LocalDateTime nowEnd = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
        LocalDateTime now = LocalDateTime.now();
        Duration duration = Duration.between(now, nowEnd);
        System.out.println(duration.getSeconds() / 60 / 60);
        String timeStr = "2025-05-20 16:27:23";
        LocalDateTime parse = LocalDateTime.parse(timeStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        long l = parse.toInstant(ZoneOffset.systemDefault().getRules().getOffset(parse))
                .toEpochMilli();
        System.out.println(l);

        List<String> list = new ArrayList<>();
        list.add("5");
        list.add("100");
        list.add("95");
        list.add("4");
        list.sort(Comparator.reverseOrder());
        System.out.println(list);

    }

}
